import React from 'react';
import Login from './login'
import Home from './home'
import Register from './register'
import ResetPassword from './reset-password'
import MessageLogin from './message-login'

import {Actions, Router, Scene, Stack} from "react-native-router-flux";
import {Dimensions, SafeAreaView, Text} from "react-native";
import GrabOrder from "./home-page/grab-order";
import ConfirmOrder from './order-page/confirm-order'
import CheckoutOrder from './order-page/checkout-order'
import PersonEditPage from "./person/person-edit-page";
import SelfReview from "./person/self-review";
import Setting from "./person/setting";
import CarList from "./person/car-list";
import NewCar from "./person/new-car";

const App = () => (
  <SafeAreaView style={{flex: 1, backgroundColor: '#fff', height: Dimensions.get('window').height}}>
    <Router>
      <Stack key="root">
        <Scene key="home" component={Home} title='主页'
               hideNavBar/>
        <Scene key="newCar" component={NewCar} title='添加' back/>
        <Scene key="carList" component={CarList} title='车辆管理'
               renderRightButton={<Text style={{color: '#1f90e6',marginRight:20}}
                                        onPress={()=>Actions.newCar()}>添加</Text>}
               back/>
        <Scene key="grabOrder" component={GrabOrder} title='抢单' back/>
        <Scene key="setting" component={Setting} title={'设置'} back/>
        <Scene key="selfReview" component={SelfReview} title='个人评价' back/>
        <Scene key="personEditPage" component={PersonEditPage} title='信息修改' back/>
        <Scene key="confirmOrder" component={ConfirmOrder} title='待确定' back/>
        <Scene key="checkoutOrder" component={CheckoutOrder} title='待结算' back/>
        <Scene key="login" component={Login} title="欢迎登陆找工程车" />
        <Scene key="messageLogin" component={MessageLogin} title="欢迎登陆找工程车" back/>
        <Scene key="resetPassword" component={ResetPassword} title="修改密码" back/>
        <Scene key="register" component={Register} title="欢迎注册找工程车" back/>
      </Stack>
    </Router>
  </SafeAreaView>
);
export default App